package com.xinhua.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinhua.domain.Ssmp;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class bookservice2 {
    @Autowired
    private IbookService ssmpService;

    @Test
    void textGetById() {
        System.out.println(ssmpService.getById(4));
    }

    @Test
    void contextsave() {
        Ssmp ssmp1 = new Ssmp();
        ssmp1.setType("测试方法");
        ssmp1.setName("测试方法123");
        ssmp1.setDescripton("测试方法aaa");
        ssmpService.save(ssmp1);

    }

    @Test
    void contextdelete() {
        ssmpService.removeById(17);

    }

    @Test
    void contextupdate() {
        Ssmp ssmp1 = new Ssmp();
        ssmp1.setId(14);
        ssmp1.setType("测试方法333");
        ssmp1.setName("测试方法123");
        ssmp1.setDescripton("测试方法aaa");
        ssmpService.updateById(ssmp1);

    }

    @Test
    void testGetAll() {
        ssmpService.list();
    }

    @Test
    void contextPage() {
        IPage<Ssmp> page = new Page<Ssmp>(2,5);
        ssmpService.page(page);
    }
}
